const { mysql } = require('../qcloud')
module.exports = async(ctx, next) => {
  //获取json中的数据（书名、作者、出版社）
  var bookName = ctx.request.body.bookName;
  var author = ctx.request.body.author;
  var press = ctx.request.body.press;

  await mysql('book').insert(ctx.request.body)

  ctx.state.data = {
    reqBookName:bookName,
    reqAuthor:author,
    reqPress:press
  }
}

